//
//  GYGoodsTableViewCell.m
//  GoodLuck
//
//  Created by 郭为勇 on 2018/3/28.
//  Copyright © 2018年 yunjiazhineng. All rights reserved.
//
static NSString *goodsCellIdentifier = @"goodsCellIdentifier";
#import "GYGoodsTableViewCell.h"

@interface GYGoodsTableViewCell ()
@property (weak, nonatomic) IBOutlet UIImageView *goodsImageView;
@property (weak, nonatomic) IBOutlet UILabel *goodsNameLable;
@property (weak, nonatomic) IBOutlet UILabel *goodsPriceLable;
@property (weak, nonatomic) IBOutlet UILabel *goodsNumLable;

@end
@implementation GYGoodsTableViewCell

+ (instancetype)cellWithTableView:(UITableView *)tableView {
    GYGoodsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:goodsCellIdentifier];
    
    if (cell == nil) {
        cell = [[[NSBundle mainBundle]loadNibNamed:NSStringFromClass([self class]) owner:nil options:nil] firstObject];
    }
    
    return cell;
}

- (void)setGoods:(GYconfirmOrderGoods *)goods {
    _goods = goods;
    
    [self.goodsImageView sd_setImageWithURL:[NSURL URLWithString:goods.goods_image_url] placeholderImage:[UIImage imageNamed:@"4"]];
    self.goodsNameLable.text = goods.goods_name;
    self.goodsPriceLable.text = [NSString stringWithFormat:@"¥%@",goods.goods_price];
    self.goodsNumLable.text = [NSString stringWithFormat:@"%@件",goods.goods_num];
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}


@end
